<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
    <title>文件上传下载</title>
</head>
<body>

<h1>文件列表</h1>

<%
    String[] list = (String[]) request.getAttribute("list");
%>
<%
    for (int i = 0; i<list.length; i++) {
%>
<a ><%=list[i]%></a> &nbsp;&nbsp;
<a href="/download?name=<%=list[i]%>">下载</a>
</br>

<%
    }
%>
<hr>
<h2>文件上传</h2>
<form action="upload" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <button>上传</button>
</form>
</body>
</html>
